//属性接口

function sayWorld(user:{name:string,age:number}){
    console.log("interface : 1 "+user.name)
}


interface Props{
    name:String;
    age:Number;
}
var u={
    name:"Tom",
    age:20
}
function sayHello(user:Props){
    console.log("interface : 2 "+user.name);
}

sayWorld({name:"Lily",age:20});
sayHello(u);

//函数接口

interface Methord{
    (name:string,age:number):string;
}

var sayMethod:Methord=function(name:string,age:number){
    return name+age;
}

console.log(sayMethod("Methord",20));

//可索引接口
interface IndexArr{
    [index:number]:string;
}
var arr1:IndexArr=["aaa","bbb"];
console.log(arr1);


//类接口
interface IBase{
    name:string;
    age:number;
    say(name:string):string
}

class SayMan implements IBase{
    name: string;
    age: number;
    constructor(name:string,age:number){
        this.name=name;
        this.age=age;
    }
    say(word: string): string {
        console.log("class interface say"+word);
        return word;
    }
}

var iman=new SayMan("Tom",20);
iman.say("Gan");


interface Index{
    age:number;
}

class Index{
   
}



